	<!-- jQuery and jQuery UI (REQUIRED) -->

	<link rel="stylesheet" type="text/css" media="screen" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css">
	<!-- elFinder CSS (REQUIRED) -->
	<?php echo $this->Html->css('elfinder.min'); ?>
	<?php echo $this->Html->css('theme_elfinder'); ?>
	<!-- elFinder translation (OPTIONAL) -->
	<?php echo $this->Html->script('admin/modificar_curs'); ?>
	<?php echo $this->Html->script('elfinder/js/elfinder.min'); ?>
	<?php echo $this->Html->script('elfinder/js/i18n/elfinder.ca'); ?>
	<!-- elFinder initialization (REQUIRED) -->


                    <div class="row" >
                    <div class="col-md-12">
                            <!-- Primary box -->
                            <div class="box box-primary" id="mod_select_curs_header">
                                <div class="box-header" onclick="switch_box('#mod_select_curs_header','#mod_select_curs');" data-toggle="tooltip" >
                                    <h3 class="box-title">Sel·leccionar curs</h3>
                                </div>
                                  <div class="box-body" id="mod_select_curs" style="height:370px;">

                                    <form role="form" id="select_mod_curs">
                                    
                                        
                                        <div class="form-group col-md-6">
                                            <label><h4><i><b>Idioma</b></i></h4></label>
                                            
                                            <select class="form-control" onClick="javascript:select_cursos_per_tipus(this.value,select_tipus_curs.value);" id="select_idioma">
                                            
                                            	
                                            		<option  value="cat">Català</option>
                                            		<option  value="es">Castellà</option>

                                            </select>
                                            
                                        </div>

                                        <div class="form-group col-md-6">
                                            <label><h4><i><b>Tipus de curs</b></i></h4></label>
                                            
                                            <select class="form-control" onClick="javascript:select_cursos_per_tipus(select_idioma.value,this.value);" id="select_tipus_curs">
                                            
                                            <!-- <select class="form-control" onfocus="select_cursos_per_tipus(this.value);" id="select_tipus_curs">  -->
                                            	<?php foreach($tipus_cursos as $curso){?>
                                            	
                                            		<option  value="<?php echo($curso->id_tipus_curs);?>"><?php echo($curso->tipus_curs);?> </option>
                                            	
                                            	<?php }?>

                                            </select>
                                        </div>

                                        <!-- Select multiple -->
                                        <div class="form-group col-md-12" >
                                        	<div class="col-md-12">
	                                            <label><h4><i><b>Escollir curs</b></i></h4></label>
	                                            <select id="llistat_cursos_per_tipus"  onclick="javascript:mostrar_info_curs(this.value);" multiple class="form-control" style="height:150px; font-weight:bold;">
	
	                                            </select>
                                            </div>
                                        </div>
	                                 </form>
                                </div><!-- /.box-body -->
                            </div><!-- /.box -->
                        </div><!-- /.col -->

                              
               </div>  
                                           
                            
               <div class="row">   	          
                            
                <div class="col-md-12">
                            <!-- Custom Tabs -->
                            <div class="nav-tabs-custom">
                                <ul class="nav nav-tabs">
                                    <li class="active"><a href="#tab_1" data-toggle="tab">Dades Curs</a></li>
                                    <li><a href="#tab_2" data-toggle="tab">Editor Text</a></li>
                                    <li><a href="#tab_3" data-toggle="tab">Gestor Contingut</a></li>
                                </ul>
                                <div class="tab-content">
                                    <div class="tab-pane active" id="tab_1">

                                    	               <div class="row" >
										                        <!-- right column -->
										                        <div class="col-md-12">
										                          <!-- general form elements disabled -->
										                            	<form name="mod_info_curs">
										                                <div class="box-body" style="height:650px;" id="modificar_campos_curso">
																			 <?php nuevo_input('4','12','Nom Curs','mod_nom_curs');?>
																			 <?php nuevo_input('12','12','Text descripció notícia','mod_text_desc');?>
																			 


										                                </div><!-- /.box-body -->
										                                </form>
										                    </div>   <!-- /.row -->                      
										                            
										               </div>      

                                    </div><!-- /.tab-pane -->
                                    <div class="tab-pane" id="tab_2">
                                   
                                    		<!--  EDITOR TEXTO -->
      										<?php echo $this->Html->script('ckeditor/ckeditor');?>
											<?php echo $this->Form->textarea('editor',array('class'=>'ckeditor'))?>
      
                                    </div><!-- /.tab-pane -->
                                    <div class="tab-pane" id="tab_3">
					                     <div id="elfinder" class="nonborderbox"></div>
                                   </div><!-- /.tab-pane -->
                                </div><!-- /.tab-content -->
                            </div><!-- nav-tabs-custom -->
                        </div><!-- /.col -->            
			</div>
      
<input type="hidden" id="mod_id_curs" ></input>
<input type="hidden" id="mod_idioma"></input>

<?php function nuevo_input($size,$input_size,$titulo,$div){?>

			<div class="col-md-<?php echo($size);?>">
				<h4><?php echo($titulo);?></h4>
	             	<div class="input-group ">
	                     <div class="input-group-btn input-group-sm">
	                          <button type="button" class="btn btn-warning dropdown-toggle" data-toggle="dropdown">Acció <span class="fa fa-caret-down"></span></button>
	                                  <ul class="dropdown-menu">
									    <li><a href="javascript:habilitar_input('#<?php echo($div);?>');">Modificar</a></li>
									   	<li><a href="javascript:netejar_input('#<?php echo($div);?>');">Netejar</a>
									    <li><a href="javascript:alert(this.value);">Guardar</a></li>
									 </ul>
	                     </div> <!-- /btn-group -->
	                     
	                <div class="col-md-<?php echo($input_size);?>">
	                	 <input type="text" id="<?php echo($div);?>"  disabled="disabled"  class="form-control">
					</div>
					
	             </div><!-- /input-group -->
			</div>
<?php }?>

<script type="text/javascript" charset="utf-8">

select_cursos_per_tipus('cat',select_tipus_curs.value);
	

var elf = $('#elfinder').elfinder({
	url : '../../../js/elfinder/php/connector.php',  // connector URL (REQUIRED)
 	lang: 'ca'             // language (OPTIONAL)
}).elfinder('instance');




CKEDITOR.plugins.registered['save'] = {
	      init: function (editor) {
	         var command = editor.addCommand('save',
	         {
	              modes: { wysiwyg: 1, source: 1 },
	              exec: function (editor) { // Add here custom function for the save button
	            	  var data = CKEDITOR.instances.editor.getData();
	            	  insert_data(data);
	              }
	         });
	         editor.ui.addButton('Save', { label: 'Save', command: 'save' });
	      }
}

</script>

